Delete Instance.dispose and Instance.reload#25427
Merged
kitlangton merged 1 commit intodevfrom May 2, 2026
Merged
Conversation
Converts the remaining ~12 callers from the legacy Instance.{dispose,reload}
wrappers to the InstanceStore.{disposeInstance,reloadInstance} helpers added
in #25424, then deletes the wrappers. project-init-git.test.ts drops its
spyOn(Instance, 'reload') in favor of asserting on the bus event count
(disposedEvents helper) — the bus event is the actual behavioral signal
the test cares about, the spy was implementation detail.
After this:
- src/project/instance.ts has 4 methods (provide, current/directory/worktree/project getters, bind, restore)
- The spy-induced flake on project-init-git tests goes away (verified locally)
Tests: 2336/2337 pass (the 1 failure is the pre-existing session.created flake on dev).
kitlangton
commented
May 2, 2026
| import { resolver } from "hono-openapi" | ||
| import { Instance } from "@/project/instance" | ||
| import { InstanceStore } from "@/project/instance-store" | ||
| import { Project } from "@/project/project" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Followup to #25424 (which added `InstanceStore.{disposeInstance, reloadInstance}` helpers and left `Instance.dispose` / `Instance.reload` as TODO-marked thin wrappers). Converts the remaining ~12 callers to use the helpers directly, then deletes the wrappers.
Changes
Tests
What's left in `Instance`
`Instance.{provide, bind, restore}` + ALS getters. These need the bigger CLI-conversion + ALS-removal work to retire (separate proposals). After that, the `Instance` namespace can be deleted entirely along with `LocalContext.create("instance")`.